package com.aliwo.service.impl;

import com.aliwo.mapper.BannerMapper;
import com.aliwo.model.BannerDO;
import com.aliwo.response.ResultResponse;
import com.aliwo.service.BannerService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xuyayuan
 * @data 2021年06月24日
 */
@Service
@Slf4j
@SuppressWarnings("all")
public class BannerServiceImpl implements BannerService {
    @Autowired
    private BannerMapper bannerMapper;
    @Override
    public ResultResponse list() {
       List<BannerDO> bannerDOList = bannerMapper.selectList(new QueryWrapper<BannerDO>());
        return bannerDOList != null && bannerDOList.size() > 0
                ? ResultResponse.buildSuccess(bannerDOList) : ResultResponse.buildError("未查询到");
    }
}
